/**
 * 跳转的封装
 * @param {string} url 跳转的url
 * @param {string} _type: 跳转的类型，默认是 navigateTo
 * @param {string | Number} delta: 跳转的类型，默认是 1
 * @param {string} params 跳转携带的参数 '?id=xxx&age=xxx'
 *
 */

export default function jump(
  _type = "navigateTo",
  url,
  delta = 1,
  params = ""
) {
  if (_type === "navigateTo") {
    uni.navigateTo({
      url: url + params,
    });
    return;
  }
  if (_type === "redirectTo") {
    uni.redirectTo({
      url: url + params,
    });
    return;
  }
  if (_type === "back") {
    uni.navigateBack({
      delta,
    });
    return;
  }
}
